<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <ul>
        <li>第一个孩子</li>
        <li>第二个孩子</li>
        <li>第三个孩子</li>
        <li>第四个孩子</li>
        <li>第五个孩子</li>
        <p>我不需要变颜色</p>
    </ul>
    <script>
        const ul = document.querySelector('ul')
        ul.addEventListener('click', function(e) { 
            // alert(11)
            // this.style.color = "red"
            // e.target.style.color = "red"
            if(e.target.nodeName === 'LI') {
                e.target.style.color = "red"
            }
            
            });
    </script>
</body>
</html>